package com.cxm.homework8.jdbcTmp.execute;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

public class Test {

    public static void main(String[] args) {
        ApplicationContext ac = new ClassPathXmlApplicationContext("com/cxm/homework8/jdbcTmp/execute/spring-config.xml");
        JdbcTemplate jdbcTemplate = (JdbcTemplate) ac.getBean("jdbcTemplate");
        String sql="CREATE TABLE `user`  (" +
                "  `id` int(0) NOT NULL AUTO_INCREMENT," +
                "  `username` varchar(20)  NOT NULL," +
                "  `password` varchar(20)  NOT NULL," +
                "  `balance`  int(20)      NOT NULL," +
                "  PRIMARY KEY (`id`) " +
                ")";
        jdbcTemplate.execute(sql);
    }
}
